package com.qd.panda.mq;

import com.qd.panda.mq.charge.ChargeConsumerService;
import com.qd.panda.mq.park.ParkConsumerService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Service;

import java.util.function.Consumer;

/**
 * 进出场推送
 *
 * @author sjk
 */
@Slf4j
@Service
@AllArgsConstructor
public class DcConsumer {
    private final ParkConsumerService parkConsumerService;
    private final ChargeConsumerService chargeConsumerService;

    /**
     * 进出场消息
     */
    @Bean
    public Consumer<String> parkConsumer() {
        return parkConsumerService::doProcess;
    }

    /**
     * 充电信息
     */
    @Bean
    public Consumer<String> chargeConsumer() {
        return chargeConsumerService::doProcess;
    }
}
